package tr.hba.jblog.view;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import tr.hba.jblog.model.Post;
import tr.hba.jblog.service.IPostService;

@Component("postList")
@Scope("request")
public class PostList implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private IPostService service;

	private List<Post> items;

	@Autowired
	public PostList(IPostService service) {
		this.service = service;

	}

	public List<Post> getItems() {
		
		items = service.findAll();
		return items;
	}

	public void setItems(List<Post> items) {
		this.items = items;
	}

}
